SET(proFile        favorite)
SET(proFileSuffix  proto)
SET(proFileGenFix  pb)
SET(inputFile ${CMAKE_CURRENT_SOURCE_DIR}/${proFile}.${proFileSuffix} )
SET(outputFile     ${proFile}.${proFileGenFix}.h ${proFile}.${proFileGenFix}.cc )

message (status "----whq--CurrentSrcDIR:" ${CMAKE_CURRENT_SOURCE_DIR})
message (status "----whq--CurrentBinDIR:" ${CMAKE_CURRENT_BINARY_DIR})

ADD_CUSTOM_COMMAND (
     OUTPUT ${outputFile} 
     COMMAND protoc -I${CMAKE_CURRENT_SOURCE_DIR} ${inputFile} --cpp_out=${CMAKE_CURRENT_SOURCE_DIR} 
     COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/${proFile}.${proFileGenFix}.h  ${CMAKE_CURRENT_BINARY_DIR} 
     COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/${proFile}.${proFileGenFix}.cc ${CMAKE_CURRENT_BINARY_DIR} 
     DEPENDS ${proFile}.${proFileSuffix} 
    )
SET(lib_favorite ${proFile}.${proFileGenFix}.h ${proFile}.${proFileGenFix}.cc)
ADD_LIBRARY(favorite STATIC ${lib_favorite})
